package com.exchange.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exchange.entity.vo.ExchangeUserVo;
import com.exchange.service.ExchangeRecordService;
import com.exchange.until.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 周佳辉
 * @date 2024/4/25
 */
@RestController
@RequestMapping("/jeecg-boot")
@Tag(name = "换电记录")
public class ExchangeRecordController {

    @Autowired
    private ExchangeRecordService exchangeRecordService;

    @GetMapping("/record")
      @Operation(summary = "查询换电记录")
    public Result<Page<ExchangeUserVo>> record(@RequestParam(value = "offset",defaultValue = "1")Integer offset,
                                               @RequestParam(value = "pagesize",defaultValue = "5")Integer pagesize,
                                               @RequestHeader String token){
        Page<ExchangeUserVo> page = this.exchangeRecordService.findAll(offset,pagesize,token);
        return new Result<>(200,"查询成功",true,page);
    }

//    @GetMapping("/record")
//    @Operation(summary = "查询换电记录")
//    public Result<Page<ExchangeUserVo>> record(@RequestParam(value = "offset",defaultValue = "1")Integer offset,
//                                               @RequestParam(value = "pagesize",defaultValue = "5")Integer pagesize){
//        Page<ExchangeUserVo> page = this.exchangeRecordService.findAll(offset,pagesize);
//        return new Result<>(200,"查询成功",true,page);
//    }
}
